from flask import session
from info import models
from flask_script import Manager
from flask_migrate import Migrate, MigrateCommand
import pymysql
pymysql.install_as_MySQLdb()

from info import create_app, db

# 生成app
app = create_app("development")

# 创建管理对象
manager = Manager(app)

# 创建迁移对象
Migrate(app, db)

# 创建迁移命令
manager.add_command('db', MigrateCommand)


if __name__ == '__main__':
    # app.run()
    manager.run()
